/**
 * 订单
 */

const err = require("./error");

module.exports = function () {
    /**
     * 创建订单
     */
    if (Memory.order) {

        err(
            Game.market.createOrder,
            Game.market.createOrder({
                type: ORDER_SELL,
                resourceType: RESOURCE_LEMERGIUM,
                price: 90.333,
                totalAmount: 2000,
                roomName: "E14S23"
            })
        );

        Memory.order = false;
    }

    /**
     * 处理订单
     */
    if (Memory.deal) {

        err(
            Game.market.deal,
            Game.market.deal('6614d7742da276001284e45c', 212, "E14S23")
        );

        Memory.deal = false;
    }
};